#ifndef CX_CLOUD_H_
#define CX_CLOUD_H_

#ifdef __cplusplus
extern "C" {
#endif

/* 产品三元组长度限制 */
#define PRODUCT_KEY_LEN     (20)
#define DEVICE_NAME_LEN     (32)
#define DEVICE_SECRET_LEN   (64)
#define PRODUCT_SECRET_LEN  (64)

typedef enum {
    CX_CLOUD_LOG_ERROR = 2,
    CX_CLOUD_LOG_WARN = 3,
    CX_CLOUD_LOG_INFO = 4,
    CX_CLOUD_LOG_DEBUG = 5,
    CX_CLOUD_LOG_VERBOSE = 6,
    CX_CLOUD_LOG_MAX = 7,
} cx_cloud_log_level_e;

typedef struct {
    int dev_id;//0-主设备，>0-子设备,<0-illegal
    char *product_key;
    char *device_name;
    char *device_secret;
    char *product_secret;
    int log_level;
} cx_cloud_param_t;

typedef struct {
    
} cx_cloud_cbs;

typedef struct {
    cx_cloud_param_t param;
} cx_cloud_priv_t;

typedef enum {
    CX_CLOUD_DIR_TO_CLOUD = 0,
    CX_CLOUD_DIR_FROM_CLOUD,
} cx_cloud_intercom_dir;

void *cx_cloud_init(cx_cloud_param_t *param, cx_cloud_cbs *cbs); /* 初始化上云模块，注册回调接口，返回handler */
int cx_cloud_deinit(void *hdl); /* 注销上云模块 */
int cx_cloud_connect(void *hdl);	/* 连接云端 */
int cx_cloud_disconnect(void *hdl);	/* 断开云端 */
int cx_cloud_switch_intercom(void *hdl, int dir_to_cloud);	/* 切换push to talk对讲方向 */

#ifdef __cplusplus
}
#endif

#endif // CX_CLOUD_H_